import request from '@/utils/request'

import { domain } from '../utils/request'

export function login(username, password, captcha) {
  return request({
    url: '/sys/login',
    method: 'post',
    params: {
      username,
      password,
      captcha
    }
  })
}

// export function getInfo(token) {
export function getInfo() {
  return request({
    url: '/sys/user/info',
    method: 'get'
    // params: { token }
  })
}

export function logout() {
  return request({
    url: '/sys/logout',
    method: 'post'
  })
}

export function kaptcha() {
  return domain + '/captcha'
}
